const DataType = {
    ARTICLE: 10,
    TAG: 10,
    NOTEBOOK: 10,
}

const RequestCode = Object.freeze({
    GET_ALL_META_DATA: 2,
    ADD_META_DATA: 3,
    UPDATE_META_DATA: 4,
    DELETE_META_DATA: 5,
    GET_ARTICLE_DATA: 6,
    ADD_SECTION_DATA: 7,
    UPDATE_SECTION_DATA: 8,
    MOVE_SECTION_DATA: 9,
    DELETE_SECTION_DATA: 10,
    GET_FOLDER_CONTENT_INFO: 20,
    UPDATE_EXTERNAL_WEB_INNFO: 30,
    UPLOAD_FILES: 40,
    CLIENT_STATUS: 998,
    ARCHIVE: 999,
});

const ResposeCode = Object.freeze({
    UNKNOW_ERROR: -999999,
    FAIL: -1,
    ACCOUNT_NOT_EXIST: -4,
    PASSWORD_ERROR: -8,
    SESSION_NOT_EXIST: -5,
    JSON_PARSING_ERROR: -50,
    INVALID_ARGUMENT: -1000,

    FILE_NOT_EXIST: -2,
    META_NOT_EXIST: -9,
    META_ALREADY_EXIST: -10,
    SECTION_NOT_EXIST: -12,
    SECTION_ALREADY_EXIST: -11,
    NOT_PUBLISHED: -100,

    SHELL_CALL_ERROR: -999,
    HEART_BEAT: 0,
    OK: 1,
    OK_WITH_INFO:2,
});

const ActionCode = {
    HEART_BEAT: 0,
    SAVE: 1,
    SAVE_AND_EXIT: 2,
    DELETE: 10,
    CANCEL: 20,
    LOGIN: 100,
    UPLOAD: 1000,
    ACTION_CONFIRMED: 5000,
    FILE_EXIST: 5100,
}

const HistoryActionType = {
    UNKNOWN: "unknown",
    NEW: "new",
    DELETE: "deleted",
    MODIFIED: "modified",
}

const _ROOT = __dirname + "/../";
const GlobalPaths = {
    ROOT: _ROOT,
    ROOT_SERVER: _ROOT + "src/",
    ROOT_CONTENT: _ROOT + "../content/",
    ROOT_CLIENT: _ROOT + "../www/",
}

module.exports = Object.freeze({
    RequestCode,
    ResposeCode,
    ActionCode,
    GlobalPaths,
    DataType,
    HistoryActionType,
});
